<template>
  <div class="header-com fzhzgbj">
    三抓三促强落实&nbsp;&nbsp;凝心聚力谋发展
    <div class="time">{{time}}</div>
  </div>
</template>

<script>
import {getCurrentTime} from "../../utils/date";

export default {
  name: "Header",
  data(){
    return{
      time:'',
      headerTimer:null,
    }
  },
  beforeDestroy() {
    this.headerTimer&&clearInterval(this.headerTimer);
  },
  methods:{
    getTime(){
      this.time=getCurrentTime('i');
    }
  },
  mounted() {
    this.getTime();
    this.headerTimer=setInterval(()=>{
      this.getTime();
    },1000)
  }
}
</script>

<style scoped lang="scss">
.header-com{
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 34px;
  color: #fff;
  background: url("/static/images/header-bg.png") no-repeat center;
  background-size: 95% auto;
  height: 80px;
  position: relative;
  .time{
    position: absolute;
    transform: translate(-50%,-50%);
    top: 40%;
    right: 40px;
    color: #fff;
    font-size: 20px;
  }
}
</style>
